package com.qww;

public class Exec06 {

    public static void main(String[] args) {
        IfElse.test(10, 5, 1, 20);
        System.out.println(IfElse2.test(10, 5, 1, 20));
    }

}

class IfElse {
    static int result = 0;
    static void test(int testval, int target, int begin, int end) {
        if (testval > begin && testval < end) System.out.println(testval + "在(" + begin + ", " + end + ")之间") ;
        if(testval > target) result = +1;
        else if(testval < target) testval = -1;
        else result = 0;
    }
}

class IfElse2 {
    static int test(int testval, int target, int begin, int end) {
        if (testval > begin && testval < end) System.out.println(testval + "在(" + begin + ", " + end + ")之间") ;
        if(testval > target) return +1;
        else if(testval < target) return -1;
        else return 0;
    }
}
